const Utils = require("./Utils.js")

Utils.init()

// 关闭好友协助申请
threads.start(() => {
	while (true) {
		sleep(30 * 1000)
		Utils.findPhotoTap("叉号", 0.8, [1100, 120, 140, 120])
	}
})

let seconds = 0
let num = 0
let flag = true
while (flag) {
	sleep(1000)
	if (Utils.findPictureTap("准备")) {
		num++
		if (num === 1) seconds = 300
		else seconds = 40
		Utils.waitTime(seconds)
	} else {
		log("已等待 " + ++seconds + " 秒")
		if (Utils.findPictureTap("胜利")) {
			log("阴界之门 - 成功")
			sleep(1000 * 8)
			Utils.findPictureTap("返回二")
			sleep(1000 * 8)
			Utils.findPictureTap("返回一")
			Utils.stopJB()
		}
	}
}
